# gjb英雄类
class Hero:
    __name = 'xxxx'
    __hp = 100
    __skills = []

    def add_skill(self, skill):
        self.__skills.append(skill)
        print(f"{skill.get__name()}技能已添加成功")

    def __init__(self, name, hp):
        self.__name = name
        self.__hp = hp

    def get__name(self):
        self.__name

    def get__hp(self):
        self.__hp

    def set__name(self, name):
        self.__name = name

    def set__hp(self, hp):
        self.__hp = hp


# gjb技能类：攻击
class skill:
    # 技能名
    __name = '技能1'
    # 技能伤害
    __killhp = 1

    def __init__(self, name, hp):
        self.__name = name
        self.__killhp = hp

    def get__name(self):
        self.__name

    def get__killhp(self):
        self.__killhp

    # True:目标已死  False:目标尚在人世
    def attack(self, hero):
        hero.set__hp(hero.get__hp() - self.__killhp)
        return hero.get__hp() < 0


lb = Hero("李白", 50)
ln = Hero("露娜", 50)
将敬酒 = skill("将敬酒", 10)
青莲剑歌 = skill("青莲剑歌", 100)
月光击 = skill("月光击", 10)
月下闪爆 = skill("月下闪爆", 100)
lb.add_skill(将敬酒)
lb.add_skill(青莲剑歌)
ln.add_skill(月下闪爆)
ln.add_skill(月光击)
